<%
layout("/layouts/platform.html"){
%>
<header class="header navbar bg-white shadow">
    <div class="btn-group tool-button">
        <a class="btn btn-default navbar-btn" href="${base}/platform/ud/coupon" data-pjax><i class="ti-angle-left"></i> 返回</a>
    </div>
</header>

<div class="content-wrap">
    <div class="wrapper" style="min-height:500px;height: 100%;">
    	<form class="form-horizontal parsley-form">
	    	<div class="row mb10">
	        	<div class="col-lg-12">
	            	<div class="form-group">
	                	<label for="coupon_name" class="col-sm-2 control-label">优惠券名称</label>
	
	                    <div class="col-sm-8">
	                    	<input type="text" id="coupon_name" class="form-control" name="coupon_name" readonly="readonly" value="${obj.coupon_name!}">
	                    </div>
	                </div>
                        <div class="form-group">
                            <label for="coupon_sub_title" class="col-sm-2 control-label">券名</label>

                            <div class="col-sm-8">
                                <input type="text" id="coupon_sub_title" class="form-control" name="coupon_sub_title"  readonly="readonly" value="${obj.coupon_sub_title!}">
                            </div>
                        </div>
                        <div class="form-group">
                                <label for="coupon_logo" class="col-sm-2 control-label">logo</label>

                                <div class="col-sm-8">
                                    <div id="img" style="padding: 5px;">
                                    	<img src="${AppUploadRoot}${obj.coupon_logo}" style='width:150px;height:95px;'>
                                    </div>
                                </div>
                            </div>
                        <div class="form-group">
                            <label for="coupon_notice" class="col-sm-2 control-label">卡券使用提醒</label>

                            <div class="col-sm-8">
                                <input type="text" id="coupon_notice" class="form-control" name="coupon_notice" readonly="readonly" value="${obj.coupon_notice!}">
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="coupon_fee" class="col-sm-2 control-label">额度</label>
                            
                            <div class="col-sm-8">
                                <input type="text" id="coupon_fee" class="form-control" name="coupon_fee" readonly="readonly" value="${obj.coupon_fee!}">
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="coupon_date_type" class="col-sm-2 control-label">使用时间类型</label>
                            
                            <div class="col-sm-8">
                                <input type="radio" name="coupon_date_type" data-parsley-required="true" value="0"  <% if(obj.coupon_date_type=='0'){ %> checked="checked" <% } %> />固定日期
                                <input type="radio" name="coupon_date_type" data-parsley-required="true" value="1"  <% if(obj.coupon_date_type=='1'){ %> checked="checked" <% } %>/>固定时长
                            </div>
                        </div>
                        <div id="FIX_TIME_RANGE" style="display: none">
	                        <div class="form-group" >
	                           	<label for="coupon_begin_timestamp" class="col-sm-2 control-label">启用时间</label>
	                           	
	                            <div class="col-sm-8">
	                                <div class="col-sm-4 input-group date form_datetime " style="padding-left: 16px;padding-right: 16px;" data-date="1979-09-16T05:25:07Z" data-date-format="dd MM yyyy - HH:ii p" data-link-field="coupon_begin_timestamp">
	                                    <input type="text" size="16" readonly class="form-control" value="<% if(obj.coupon_date_type=='0'){ %>${@date.getDate(obj.coupon_begin_timestamp!)}<% } %>" data-parsley-required="true">
	                                </div>
	                            </div>
	                        </div>
	                        <div class="form-group">
	                           <label for="coupon_end_timestamp" class="col-sm-2 control-label">结束时间</label>
	                           	
	                            <div class="col-sm-8">
	                                <div class="col-sm-4 input-group date form_datetime " style="padding-left: 16px;padding-right: 16px;" data-date="1979-09-16T05:25:07Z" data-date-format="dd MM yyyy - HH:ii p" data-link-field="coupon_end_timestamp">
	                                    <input type="text" size="16" readonly class="form-control" value="<% if(obj.coupon_date_type=='0'){ %>${@date.getDate(obj.coupon_end_timestamp!)}<% } %>" data-parsley-required="true">
	                                </div>
	                            </div>
	                        </div>
                        </div>
                        <div class="form-group" id="FIX_TERM"  style="display: none">
                            <label for="coupon_fixed_term" class="col-sm-2 control-label">时长</label>
                            
                            <div class="col-sm-8">
                               <input type="text" id="coupon_fixed_term" class="form-control" name="coupon_fixed_term"  readonly="readonly" value="${obj.coupon_fixed_term!}">
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="coupon_quantity" class="col-sm-2 control-label">数量</label>
                            
                            <div class="col-sm-8">
                                <input type="text" id="coupon_quantity" class="form-control" name="coupon_quantity" readonly="readonly" value="${obj.coupon_quantity!}">
                            </div>
                        </div>
                         <div class="form-group" >
	                    	<label for="coupon_fixed_term" class="col-sm-2 control-label">每人领取数</label>
	                            
	                        <div class="col-sm-8">
	                 	       <input type="text"   id="max_num" class="form-control" value="${obj.max_num!}" readonly="readonly">
	                        </div>
	                    </div>
                        <div class="form-group">
                            <label for="coupon_synopsis" class="col-sm-2 control-label">简介</label>
                            
                            <div class="col-sm-8">
                                <input type="text" id="coupon_synopsis" class="form-control" name="coupon_synopsis" readonly="readonly" value="${obj.coupon_synopsis!}">
                            </div>
                        </div>
                  	<div class="form-group">
                            <label for="coupon_remark" class="col-sm-2 control-label">备注</label>
                            
                            <div class="col-sm-8">
                                <input type="text" id="coupon_remark" class="form-control" name="coupon_remark" readonly="readonly" value="${obj.coupon_remark!}">
                            </div>
               		</div>
            	</div>
        	</div>
        </form>
    </div>
</div>
<a class="exit-offscreen"></a>
<script>
	$(document).ready(function () {
		var value= ${obj.coupon_date_type};
		if(value==0){
    		$("#FIX_TIME_RANGE").css('display','block'); 
    		$("#FIX_TERM").css('display','none'); 
    	}
    	if(value==1){
    		$("#FIX_TERM").css('display','block'); 
    		$("#FIX_TIME_RANGE").css('display','none'); 
    	}
	});
</script>
<%}%>